package kaka.controls.container
{
	import mx.containers.Canvas;
	import mx.containers.ViewStack;
	import mx.core.UIComponent;
	import mx.effects.TweenEffect;
	import mx.events.FlexEvent;
	
	import org.efflex.mx.viewStackEffects.CoverFlowPapervision3D;
	import org.efflex.mx.viewStackEffects.CubePapervision3D;
	import org.efflex.mx.viewStackEffects.Fade;
	import org.efflex.mx.viewStackEffects.List;

	public class EffectViewStack extends ViewStack
	{
		private var _effect:TweenEffect;
		public function EffectViewStack()
		{
			super();
		}
		[Inspectable(enumeration="CoverFlowPapervision3D,CubePapervision3D,Fade,List", defaultValue="Fade")]
		public function set effectType(type:String):void
		{
			switch(type)
			{
				case "CoverFlowPapervision3D":
					_effect=new CoverFlowPapervision3D(); 
					(_effect as CoverFlowPapervision3D).direction="horizontal"
					break;
				
				case "CubePapervision3D":
					_effect=new CubePapervision3D(); 
					(_effect as CubePapervision3D).direction="horizontal"
					break;
				case "Fade":
					_effect=new Fade();
					break;
				case "List":
					_effect=new List();
					(_effect as List).direction="horizontal";
					break;
				
			}
		}
		/**
		 * 添加子容器
		 * @author kaka
		 * @param items  
		 **/
//		public function addItem(items:Array):void
//		{
//			for(var i:int=0;i<items.length;i++)
//			{
//				var cav:Canvas=new Canvas();
//				cav.percentHeight=100;
//				cav.percentWidth=100;
//				var item:UIComponent=items[i] as UIComponent;
//				item.setStyle("showEffect",_effect);
//				item.setStyle("hideEffect",_effect);
//				cav.addChild(item);
//				this.addChild(cav);
//			}
//		}
	}
}